<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            display:flex;
            flex-direction:column;
            justify-content:center;
            align-items:center;
        }
        .shell{
            display:flex;
            flex-direction:column;
            justify-content:center;
            align-items:center;
            width:400px;
            height:500px;
            background-color: darkcyan;
        }
        /* 对于filed我们是需要在这个上面添加一些东西来进行操作 */
        .filed{
            position:relative;
            background-color: aliceblue;
            line-height: 20px;
            overflow: hidden;
            /* width:100px; */
        }
        .filed:nth-child(1){
            margin-top:-150px;
        }
        .filed:nth-child(2){
            margin-top:-100px;
        }
        .filed::before{
            content:"";
            position: absolute;
            bottom:0;
            height: 5px;
            /* 如果自己的父亲不添加相对定位，哪么就会相对于爷爷进行绝对定位 */
            width: 100%;
            background: linear-gradient(to right,red,blue,green,black,white,red);
            transform:translateX(-100%);
            transition:.2s;
        }
        .filed:hover::before{
            transform:translateX(0%);
        }
        
    
    </style>
</head>
<body>
    <div class="shell">
        <div class="filed"><input type="text" placeholder="请输入账号"></div>
        <div class="filed"><input type="text" placeholder="请输入密码"></div>
    </div>    
</body>
</html>